﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PostEffectBase : MonoBehaviour
{

    [Range(0.0f,0.1f)]
    public float DistortTimeFator = 0.15f;

    [Range(0.0f,0.2f)]
    public float DistorStrength = 0.01f;

    public Texture NoiseTexture = null;

    public Material _Material;
    private void OnRenderImage(RenderTexture src, RenderTexture dest)
    {
        if (_Material)
        {
            _Material.SetTexture("_NoiseTex",NoiseTexture);
            _Material.SetFloat("_DistortTimeFactor",DistortTimeFator);
            _Material.SetFloat("_DistortStrength",DistorStrength);
            Graphics.Blit(src,dest,_Material);
        }
        else
        {
            Graphics.Blit(src,dest);
        }
        
        
    }
}
